﻿using System;
using System.IO;
using System.Windows.Forms;

namespace NTTDATA.BEENChina.CaseMonitor
{
    public partial class FormMain : Form
    {   
        public FormMain()
        {
            InitializeComponent();
        }

        private void FormMain_Load(object sender, EventArgs e)
        {
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            string path = @"C:\myfile.txt";
            FileInfo fileInfo = new FileInfo(path);
            Console.WriteLine(fileInfo.Exists);
            Console.WriteLine(File.Exists(path));

          

            string curFile = @"temp.A";

            Path.Combine(AppDomain.CurrentDomain.BaseDirectory, curFile);

            Path.GetFileName(@"temp.A");

            Console.WriteLine(File.Exists(curFile) ? "File exists." : "File does not exist.");

             curFile = @"temp.xml";

            Path.Combine(AppDomain.CurrentDomain.BaseDirectory, curFile);

            Console.WriteLine(File.Exists(curFile) ? "File exists." : "File does not exist.");


           /* ServerChecker.ServerChecker serverChecker = new ServerChecker.ServerChecker();
            serverChecker.NoteList = new List<Server>();
            
            serverChecker.NoteList.Add(new Management(){Address = "xxx",Name = "ma01"});
            serverChecker.NoteList.Add(new Relay() { Address = "xxx", Name = "re01" });

            ServerChecker.ServerChecker serverCheckerA = new ServerChecker.ServerChecker();
            serverCheckerA.NoteList = new List<Server>();
            serverCheckerA.NoteList.Add(new Management() { Address = "xxx", Name = "ma02" });
            serverCheckerA.NoteList.Add(new Relay() { Address = "xxx", Name = "re02" });

            List<ServerChecker.ServerChecker> checks = new List<ServerChecker.ServerChecker>();
            checks.Add(serverChecker);
            checks.Add(serverCheckerA);
            ServerChecker.RunningChecker.SetObject(@"RunningCheckerConfig.xml", checks);*/


           // RunningChecker checker = RunningChecker.getInstance(1000);

          //  checker.Check();
        }

        
    }
}